<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
    span.highlighted {
            color: red;
    }
    </style>
</head>
<body>


{% load highlight  %}
{% if query %}

    <h3>搜索结果如下：</h3>

    {% for result in page.object_list %}

{#        <a href="{{ result.object.get_absolute_url }}">{{ result.object.title }}</a><br/>#}
        {% highlight result.object.title with query  max_length 40 start_head True %}<br/>
    {% empty %}
        <p>啥也没找到</p>
    {% endfor %}

    {% if page.has_previous or page.has_next %}
        <div>
            {% if page.has_previous %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; 上一页{% if page.has_previous %}</a>{% endif %}
        |
            {% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}下一页 &raquo;{% if page.has_next %}</a>{% endif %}
        </div>
    {% endif %}
{% endif %}
<a href="/">重新搜索<a>
</body>
</html>